import axios from 'axios';
import * as util from '../assets/util.js';
// const apiUrl='https://allcaster.com:9000/auth/api';//正式地址
const apiUrl='http://192.168.80.213:7001/waleychain/api';
// const apiUrl='http://localhost:7001/waleychain/api';

const instance = axios.create({
  // baseURL: 'http://rap2api.taobao.org/app/mock/224',
  baseURL: apiUrl,
  timeout: 10000
});

instance.defaults.headers.post['Content-Type'] = 'application/json';
instance.defaults.headers.common['Authorization'] = "test";

//错误处理
instance.interceptors.response.use(function(response) {
  return response;
}, util.catchError);
/*instance.interceptors.response.use(function(response) {
  return response;
},err=>{
	console.log(err)
});*/

export default instance;